count subarrays of length three with a condition java

join shbcf.ru